﻿// JavaScript Document
function getobj(itemid){
    return document.getElementById(itemid)
}

function isUndefined(variable) {
    return typeof variable == 'undefined' ? true : false;
}

function isnull(variable) {
    return variable == null ? true : false;
}

function Fun_PubSwitch_V(itemid){
    if (getobj(itemid).style.visibility == "hidden") {
        getobj(itemid).style.visibility = "";
    }
    else{
        getobj(itemid).style.visibility = "hidden";
    }
}

function showobj(itemid){
    getobj(itemid).style.display = ""
}

function hideobj(itemid){
    getobj(itemid).style.display = "none"
}

function autoswitch (itemid){
    if (getobj(itemid).style.display != "")getobj(itemid).style.display = "";
    else getobj(itemid).style.display = "none";
}

function changClass(Front,id,count,de_class,indexclass,show){
    
    for(i=1;i<=count;i++){
        getobj(Front + i).className = de_class;
        if (show != false){
            getobj(Front + "S_" + i).style.display = "none";
        }
    }
    
    getobj(Front + id).className = indexclass;
    if (show != false){
        getobj(Front + "S_" + id).style.display = "";
    }
}


function changClass_Special(Front,id,count,de_class,indexclass){
    
    for(i=1;i<=count;i++){
        if (i == count)
            getobj(Front + i).className = de_class + " noborder";
        else
            getobj(Front + i).className = de_class;
    }
    
    getobj(Front + id).className = indexclass;
}


function allchangClass(form,itemid,de_class,indexclass){
    var form = getobj(form);
    var item_arr = form.getElementsByTagName('li');
    for (var i=0;i<item_arr.length;i++){
        var e = item_arr[i];
        if (e.value == 1)
            e.className = de_class;
    }
    getobj(itemid).className = indexclass;
}


function onechangClass(itemid,de_class,indexclass){
    if (getobj(itemid).className == de_class){
        getobj(itemid).className = indexclass;
    }
    else{
        getobj(itemid).className = de_class;
    }
}